package com.ws.keyword;

public class Student extends Person {

    String major;
    int id = 1002;//学号

    public Student() {

    }

    public Student(String major) {
        this.major = major;
    }

    public Student(String name, int age, String major) {
        super(name, age);
        this.major = major;
    }

    @Override
    public void eat() {
        System.out.println("学生吃饭");
//        super.eat();
    }

    public void study() {
        System.out.println("学生学习知识");
        super.eat();
    }

    public void show() {
        System.out.println("name = " + this.name + ", age = " + super.age);
        System.out.println("id = " + this.id);
        System.out.println("id = " + super.id);
    }
}
